﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Microsoft.Xna.Framework;

namespace Jemgine.MapEditor.Operations
{
	internal class SetTint : Operation
	{
        Data.Tintable Tintable;
        Vector4 OldTint;
        Vector4 NewTint;

        internal SetTint(Data.Tintable Tintable, Vector4 NewValue)
        {
            this.Tintable = Tintable;
            NewTint = NewValue;
            OldTint = Tintable.GetTint();            
        }

        internal override ReturnCode Do(EditorState ES)
        {
            Tintable.SetTint(NewTint);
            return ReturnCode.AddToUndoStack;
        }

		internal override void Undo(EditorState ES)
		{
            Tintable.SetTint(OldTint);
		}



	}
}
